/* $Id$ */
package org.crazydays.gameplan.db.io;


import java.io.IOException;

import org.junit.*;
import static org.junit.Assert.*;

import org.crazydays.gameplan.db.Database;
import org.crazydays.gameplan.db.io.DatabaseInputStream;
import org.crazydays.junit.TestHelper;

/**
 * DatabaseInputStreamUnitTest
 */
public class DatabaseInputStreamUnitTest
{
    /** test helper */
    protected TestHelper testHelper =
        new TestHelper(DatabaseInputStreamUnitTest.class);

    /**
     * Test integration.
     * 
     * @throws IOException
     */
    @Test
    public void testIntegration()
        throws IOException
    {
        // input stream
        DatabaseInputStream stream =
            new DatabaseInputStream(testHelper
                .getResourceAsStream("ThreeMaps.gp1"));

        // test
        Database database = stream.readDatabase();
        stream.close();

        // verify
        assertEquals("database.gameMap.size", 3, database.getGameMaps().size());
    }
}
